import users from './users.mjs';

export async function isValidatedUser(user) {
  if (!user) return false;
  if (!user.username) return false;
  if (!user.password) return false;

  const foundUser = users.find((u) => u.username === user.username);
  if (!foundUser) return false;
  if (foundUser.password !== user.password) return false;
  return true;
}
